import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Dem02 {
    public static void main(String[] args) {
        String regex = "\\d+";
        Pattern pattern = Pattern.compile(regex);
        String text = "123456";
        Matcher matcher = pattern.matcher(text);
        boolean isMatched = matcher.matches();
        System.out.println(isMatched);
    }
}
